
define([
    "jquery",
    "IO",
    "UPLOADUI",
    "UPLOAD",
    "jqueryUI",
    "bootbox",
    //"text!/js/biz/keb/activity/definebt.html"
], function ($, IO, upui, up, jui, bootbox, definebt) {

    $(document).on("click",".publish",function(){

        var major_name = $("#major_name").val();

        var major_desc=editor.html();

        var briefdesc=$("#briefdesc").val();

        var param = {major_name:major_name,major_desc:major_desc,briefdesc:briefdesc};



        if(major_name==""){
            alert("请输入专业名称");
            return;
        }

        if(param&&param!='undefined'){
            bootbox.confirm("确定要添加该专业",function(result){
                if(result) {
                    IO.post("/pte/api/addMajor",param,function(d){
                        bootbox.alert(d.msg,function(){
                            if (d.code == 0) {
                                location.href = '/pte/major';
                            }
                        })
                    });
                }
            });
        }
    })
});

